package com.lam.system.listener;

import com.lam.common.components.easyexcel.imp.listener.BaseListener;
import com.lam.common.components.easyexcel.imp.model.ImportWrapper;
import com.lam.system.entity.SysUser;
import com.lam.system.entity.imp.SysUserImp;
import com.lam.system.service.SysUserService;

/**
 * 用户信息导入读取类 
 * 此类不能单例，要每次读取excel都要new 
 * @author admin
 *
 */
public class UploadSysUserListener extends BaseListener<SysUserImp, SysUser> {
	
	private SysUserService sysUserService;

	public UploadSysUserListener(SysUserService sysUserService) {
		super(SysUserImp.class, SysUser.class);
		this.sysUserService = sysUserService;
	}

	//重新该方法可自定义校验数据
//	@Override
//	protected String checkData(ImportEntry<SysUserImp, SysUser> wrapper) {
//		//自定义校验数据逻辑
//		return null;
//	}

	@Override
	protected void saveSuccessData(ImportWrapper<SysUserImp, SysUser> wrapper) {
		
		sysUserService.importData(wrapper);
	}


}
